﻿<?php
require_once(dirname(__FILE__)."/../../libs/login/login.php");  
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../admin/libs/product_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$pd=new product();

if (isset($_POST["Submit"])&&$_POST["Submit"]!="")
{
	if ($_POST["classname"]==""){$mc->msg("类别不能为空","go");}
	
	if($pd->cata_add($_POST["classname"],$_POST["pid"],$_POST["content"],$_POST["classorder"])){
	$mc->msg("添加成功","product_class.php?classid=".$_GET['classid']);
	}else{
	$mc->msg("添加失败","product_class.php?classid=".$_GET['classid']);	
	}
}
$path="添加产品类别";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="100%" height="24" class="top_head">&nbsp;</td>
          </tr>
          <tr>
            <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="1%" align="right"  height="45">&nbsp;</td>
                    <td width="99%" >
                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b><a href="product_class.php" style=" margin-left:20px; text-decoration:underline;">返回列表</a></td>
                        <td width="45%" align="right">&nbsp;</td>
                      </tr>
                    </table>
                    </td>
                  </tr>
                </table>
            </td>
          </tr>
   </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">
  
  
  <tr>
    <td width="11%" height="50" align="right">类别名称：</td>
    <td height="50"><input name="classname" type="text" id="classname" ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle" >上级类别：</td>
    <td height="50" valign="middle" ><select name="pid" id="pid">
          <option value="0">无</option>
          <?php
          $db->depth=0;
          $twhere="";
          $db->getchild("product_class",0,$mc->Ismp($_GET["id"]),"ID",".",$twhere);
          ?>
        </select><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">类别排列：</td>
    <td height="50" valign="middle"><input name="classorder" type="text" id="classorder" value="0" ><Font>
   (必须为数字)</Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">备注说明：</td>
    <td height="50" valign="middle"><textarea name="content" id="content" cols="30" rows="2"></textarea>
      <Font>
   </Font></td>
    </tr>
  
  
  
  
  
  <tr>
    <td height="50" align="right" valign="middle">&nbsp;</td>
    <td height="50" valign="middle"><bdo>
      <input type="submit" name="Submit" value="提交"> <input type="button" name="Submit2" value="返回" onClick="location.href='product_class.php'">
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>
